﻿


google.load("maps", "2");

var mapId = null;
var point = null;

$(function() {
    mapId = $.query.get('mapc');
    point = $.query.get('point');
    initialize();
}
);

//document.body.unload = function() { GUnload(); };

var map = null;
var geocoder = null;
function initialize() {
    if (GBrowserIsCompatible()) {
        map = new google.maps.Map2(document.getElementById(mapId));
        var xy = point.split(',');
        map.setCenter(new google.maps.LatLng(xy[0], xy[1]), 13);
        geocoder = new google.maps.ClientGeocoder();
    }
}
function showAddresses() {

}
function showAddress(address) {
    if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
              if (!point) {
                  alert("不能解析: " + address);
              } else {
                  map.setCenter(point, 13);
                  var marker = new google.maps.Marker(point);
                  map.addOverlay(marker);
                  marker.openInfoWindowHtml(address);
              }
          }
        );
    }
}
